package com.cx.mall.api.order;

import com.cx.mall.common.utils.ResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "orderDetail", name = "mall-order-service")
public interface OrderDetailFeign {
    @GetMapping("/order/orderDetail/listByIds/{id}")
    ResponseVO listById(@PathVariable Long id);
    /**
     * 新增订单详情
     * @param orderId 订单ID（关联订单主表）
     * @param skuId 商品SKU ID
     * @return 响应体，success为true表示创建成功
     */
    @PostMapping("/order/detail/save")
    ResponseVO<Boolean> save(
            @RequestParam("orderId") String orderId,
            @RequestParam("skuId") String skuId
    );

    /**
     * 根据订单ID删除关联的所有订单详情
     * @param orderId 订单ID
     * @return 响应体，success为true表示删除成功
     */
    @DeleteMapping("/order/detail/deleteByOrderId")
    ResponseVO<Boolean> deleteByOrderId(@RequestParam("orderId") String orderId);
}
